//package com.pro.staffmanage.dao;
//
//import com.pro.staffmanage.pojo.Department;
//import com.pro.staffmanage.pojo.Employee;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import java.util.Collection;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @Author: Haotian Cui
// * @Date: 2022/7/22 - 07 - 22 - 15:51
// * @Description: com.pro.staffmanage.dao
// * @Project: staffmanage
// * @version: 1.0
// */
//@Repository
//public class EmployeeDao {
//
//    @Autowired
//    public DepartmentDao departmentDao;
//
//    public static Map<Integer , Employee> employeeMap = null;
//
//    static{
//        employeeMap = new HashMap<>();
//
//        employeeMap.put(100101, new Employee(100101, "AA", "123456@qq.com", 1, new Department(101, "教学部")));
//        employeeMap.put(200101, new Employee(200101, "BB", "456789@qq.com", 0, new Department(102, "市场部")));
//        employeeMap.put(300101, new Employee(300101, "CC", "789456@qq.com", 1, new Department(103, "教研部")));
//        employeeMap.put(400101, new Employee(400101, "DD", "456123@qq.com", 0, new Department(104, "运营部")));
//        employeeMap.put(500101, new Employee(500101, "EE", "134679@qq.com", 1, new Department(105, "后勤部")));
//    }
//
//    //  Primary key auto increment!!!
//    private static Integer initID = 100101;
//
//    //  crud
//
//    //  Adding Employee
//    public void addEmployee(Employee employee){
//        if ( employee.getId() == null ){
//            initID++;
//            employee.setId(initID);
//        }
//        employee.setDepartment(departmentDao.getDepartment(employee.getDepartment().getId()));
//        employeeMap.put(employee.getId(), employee);
//    }
//
//    //  Query all employees
//    public Collection<Employee> getAllEmployee(){
//        return employeeMap.values();
//    }
//
//    //  Check a single employee by id
//    public Employee getEmployee(Integer id){
//        return employeeMap.get(id);
//    }
//
//    //  delete employee
//    public void deleteEmployee(Integer id){
//        employeeMap.remove(id);
//    }
//
//}
